const express = require("express");
const router = express.Router();
const pool = require("../../../src/pg/config/pg");
//添加数据
router.post("/add", async (req, res) => {
    const name = req.body.name;
    
    const cloud = req.body.cloud;
    const remote = req.body.remote;
    console.log(name)
  
    await pool.query(
      " insert into schg ( name,   remote , cloud ) values (   ($1),  ($2),($3)   );",
      [name,   remote,  cloud],
      (err) => {
        if (err) {
          return res.status(200).json(err.message);
          res.end;
        }
        res.status(200).json("数据添加成功");
        res.end;
      }
    );
  });
module.exports = router